package me.zhengjie.app.system.service.dto;

import lombok.Data;
import me.zhengjie.modules.security.service.dto.JwtUserDto;
import me.zhengjie.modules.security.service.dto.OnlineUserDto;

@Data
public class MemberInfo {
    private String avatarPath;
    private String id;
    private String merchant_id;
    private String department_id;
    private String username;
    private int type = 1;
    private String realname;
    private String head_portrait;
    private String gender;
    private String qq;
    private String email;
    private String birthday;
    private String province_id;
    private String city_id;
    private String area_id;
    private String address;
    private String mobile;
    private String home_phone;
    private String dingtalk_robot_token;
    private String visit_count;
    private String last_time;
    private String last_ip;
    private String role;
    private int status = 1;
    private String created_at;
    private String updated_at;

    public MemberInfo(){

    }

    public MemberInfo(JwtUserDto jwtUser) {
        this.id = jwtUser.getUser().getId().toString();
        this.merchant_id = jwtUser.getUser().getId().toString();
        this.department_id = jwtUser.getUser().getDept().getId().toString();
        this.realname = jwtUser.getUser().getNickName();
        this.username = jwtUser.getUsername();
        this.mobile = jwtUser.getUser().getPhone();
        this.email = jwtUser.getUser().getEmail();
        this.gender = jwtUser.getUser().getGender();
        this.role = "";
    }

    public MemberInfo(OnlineUserDto onlineUser) {
        this.id = "";
        this.merchant_id = "";
        this.department_id = onlineUser.getDept();
        this.realname = onlineUser.getNickName();
        this.username = onlineUser.getUserName();
        this.mobile = onlineUser.getPhone();
        this.email = "";
        this.type = onlineUser.getAccessType();
        this.address = onlineUser.getAddress();
        this.role = "";
    }

}
